<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="/projet1c-war/resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="/projet1c-war/resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <title><ui:insert name="title">Projet 1</ui:insert></title>
    </h:head>

    <h:body>

        <div id="header">
            <ui:insert name="header">
                <p:panel> 
                    <h:graphicImage   alt="The image could not be found." value="/resources/img/banniere_seltz.jpg" />
                    <br/>
                        <h:form id="loginForm">
                            <p:panel rendered="#{!mbeanLogin.logged}">
                            <p:panelGrid  style="width:300px; height: 150px;" styleClass="panelgridlogin">  
                                
                                <p:row>
                                    <p:column>
                                        <h:outputLabel for="email" value="Email :" />  
                                    </p:column>
                                    
                                    <p:column>
                                        <p:inputText id="email" value="#{mbeanLogin.email}" style="width:120px"/> 
                                    </p:column>
                                </p:row>
                                
                                <p:row>
                                    <p:column>
                                         <h:outputLabel for="pass" value="Mot de passe:" /> 
                                    </p:column>
                                    
                                    <p:column>
                                        <p:password id="pass" value="#{mbeanLogin.password}" style="width:120px"/>
                                    </p:column>
                                </p:row> 
                               
                                                        <p:row>
                                        <p:column colspan="2">
                                        <center><h:outputLabel rendered="#{mbeanLogin.erreurConnexion}" value="Email ou mot de passe incorrect" style="color: red"/></center>
                                        </p:column>
                                    </p:row>
                                    <p:row>
                                        <p:column>
                                        <p:commandButton value="Connexion" icon="ui-icon-check" style="margin:0"  action="#{mbeanLogin.seConnecter}" update="loginForm" ajax="false"/>
                                        </p:column>
                                        <p:column>
                                        <p:commandButton value="S'enregistrer" icon="ui-icon-check" style="margin:0"  action="CreerUnCompte.xhtml" ajax="false"/>
                                        </p:column>
                                    </p:row>
                                    
                                    <p:row>
                                        <p:column colspan="2">
                                            <center><h:outputLink  rendered="#{mbeanLogin.erreurConnexion}" value="recupererpasse.xhtml"><h:outputText value="Mot de passe perdu" style="color: red"/></h:outputLink></center>
                                        </p:column>
                                    </p:row>
                                
                                <f:facet name="footer">
                                    
            
                                    
                                </f:facet>


                            </p:panelGrid>  
                            </p:panel>
                            <p:panel rendered="#{mbeanLogin.logged}" style="width:300px;">
                                <center>
                                    Bienvenu <h:outputLabel value="#{mbeanLogin.compteClient.prenom}" />
                                    <p:commandButton icon="ui-icon-closethick" action="#{mbeanLogin.seDeconnecter}" update="loginForm" style="left: 20px;with:20px; height:20px; position:relative;"/>
                                </center>
                            </p:panel>
                        </h:form>
                        <br/>
                        <p:panel >
                            <h:form>
                            <p:commandButton action="panier.xhtml" value="Aller au panier"/>
                            </h:form>
                        </p:panel>
                </p:panel>
            </ui:insert>
        </div>
        <div>
            <div id="navigation">
                <ui:insert name="navigation">Navigation</ui:insert>
            </div>
            <div id="content" class="left_content">
                <ui:insert name="content">
                    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
                </ui:insert>
            </div>
        </div>
        <div id="footer">
            <ui:insert name="footer">Footer</ui:insert>
        </div>

    </h:body>

</html>
